package com.ys.object;

/**
 * @author CodeYang
 * @Description 一个交换数据的类
 * @Date 2020/12/12 16:29
 */
public class SwapObject {

    int a;
    int b;

    public SwapObject() {

    }

    public SwapObject(int a, int b) {
        this.a = a;
        this.b = b;
//        // 其实 SwapObject----> 时对象
//        SwapObject.this.SwapNumber();  ===  SwapNumber();
        System.out.println(SwapObject.this);
        SwapNumber();
    }

    void SwapNumber() {

        int temp = a;
        a = b;
        b = temp;

    }


}
